const state = {
  userInfo: JSON.parse(localStorage.getItem('userdata')),
}

const mutations = {
  GET_USERINFO: (state, data) => {
      state.userInfo = data
  }
}

const actions = {//用于处理异步操作
  getUserInfo({ commit }, data) {//commit 来自于context.commit
    commit('GET_USERINFO', data)
  },
  getCanHandle({ commit }, data) {//commit 来自于context.commit
    commit('GET_CANHANDLE', data)
  }
}

export default {
  state,
  mutations,
  actions
}

